<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./TemplatePrincipal.xhtml">

            <ui:define name="top">
                <center> Autor Crear Edtar </center>
            </ui:define>

            <ui:define name="left">
                left
            </ui:define>

            <ui:define name="right">
                right
            </ui:define>

            <ui:define name="content">
               
                <f:view>
                    <h:form>
                        <h1><h:outputText value="Crear Autor"/></h1>
                        <h:panelGrid columns="2">
                            <h:outputLabel value="Clave:" for="clave" />
                            <p:inputText id="clave" value="#{autorBean.author.clave}" title="Clave" required="true" requiredMessage="The Clave field is required." validatorMessage="se aceptan  de 1000 a 9999 digitos" ></p:inputText>
                            <f:validateLongRange minimum="1000" maximum="9999"/>
                            <h:outputLabel value="Nombre:" for="nombre" />
                             <p:inputText id="nombre" value="#{autorBean.author.nombre}" title="Nombre" required="true" requiredMessage="The Nombre field is required." validatorMessage="solo acepta  de 3 a  45  caracteres"></p:inputText>
                           <f:validateRegex pattern="[a-z]{3,45}"/>
                            <h:outputLabel value="ApellidoPaterno:" for="apellidoPaterno" />
                             <p:inputText id="apellidoPaterno" value="#{autorBean.author.apellidoPaterno}" title="ApellidoPaterno" required="true" requiredMessage="The ApellidoPaterno field is required." validatorMessage="solo  acepta  de 3 a  45  cracteres" ></p:inputText>
                            <f:validateRegex pattern="[a-z]{3,45}"/>
                             <h:outputLabel value="ApellidoMaterno:" for="apellidoMaterno" />
                              <p:inputText id="apellidoMaterno" value="#{autorBean.author.apellidoMaterno}" title="ApellidoMaterno" validatorMessage="solo  acepta  de  3 a 45 caracteres"  ></p:inputText>
                              <f:validateRegex pattern="[a-z]{3,45}"/>
                             <p:commandButton action="AutorConfirmar" value="Aceptar"/>
                             <f:validateLength minimum="3" maximum="45"/>
                             <p:commandButton action="Autor" value="cancelar" immediate="true" ajax="false"/>
                        </h:panelGrid>
                    </h:form>
                </f:view>

            </ui:define>

        </ui:composition>

    </body>
</html>
